/*
 * Created by IntelliJ IDEA.
 * User: amrk
 * Date: 14/02/2005
 * Time: 23:25:05
 */
package com.talios.jira.browser;

import com.intellij.util.ui.ColumnInfo;

import java.util.Comparator;

public class ReflectiveColumnInfo extends ColumnInfo {
    private ColumnMetaInfo columnMetaInfo;

    public ReflectiveColumnInfo(String string) {
        super(string);
    }

    public ReflectiveColumnInfo(String columnName, ColumnMetaInfo columnMetaInfo) {
        super(columnName);
        this.columnMetaInfo = columnMetaInfo;
    }

    public Object valueOf(Object object) {
        return object;
    }

    public Comparator getComparator() {
        return new ReflectiveIssueComparator(columnMetaInfo.getFieldNames());
    }

    public ColumnMetaInfo getColumnMetaInfo() {
        return columnMetaInfo;
    }


}